package test;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class MeiTuan1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int p = scanner.nextInt();
        int q = scanner.nextInt();
        Set<Integer> numsp = new HashSet<>();
        Set<Integer> numsq = new HashSet<>();
        for (int i = 0; i < p; i++) {
            numsp.add(scanner.nextInt());
        }
        for (int i = 0; i < q; i++) {
            numsq.add(scanner.nextInt());
        }
        getRes(numsp,numsq,n);
    }

    private static void getRes(Set<Integer> numsp, Set<Integer> numsq, int n) {
        int countP = 0;
        int countQ = 0;
        int countA = 0;
        for (int i = 1; i <= n; i++) {

            if (numsp.contains(i) && numsq.contains(i)){
                countA ++;
            } else {
                if (numsp.contains(i)){
                    countP ++;
                }
                if (numsq.contains(i)){
                    countQ ++;
                }
            }
        }
        System.out.println(countP + " " + countQ + " " + countA);
    }
}
